package mongo

import (
	"gitee.com/csingo/cDB/drivers"
)

const (
	Driver drivers.DBDriver = "mongo"
)

type Connection struct {
	Driver   drivers.DBDriver  `json:"driver"`
	Debug    bool              `json:"debug"`
	Hosts    []string          `json:"hosts"`
	Username string            `json:"username"`
	Password string            `json:"password"`
	Database string            `json:"database"`
	AuthDB   string            `json:"auth_db"`
	Options  map[string]string `json:"options"`
}

func (i *Connection) GetDriver() drivers.DBDriver {
	return i.Driver
}

func (i *Connection) IsDebug() bool {
	return i.Debug
}

func (i *Connection) NewConnector(name string) (drivers.ConnectorInterface, error) {
	return NewMongoConnector(name, i)
}
